{template header}

<style type="text/css">
td{font-size: 12px;}
</style>
<div class="tabbable mt-10" id="tabs-82287">
    <ul class="nav nav-tabs">
        <li class="active">
            <a href="#panel-665242" data-toggle="tab">参与情况</a>
        </li>
        <li>
            <a href="#panel-158419" data-toggle="tab">中奖情况</a>
        </li>
    </ul>
    <div class="tab-content">
    <div class="tab-pane" id="panel-158419">
    <h4 style="padding-left:10px;;">
        <span>奖品剩余数量</span>
    </h4>

    <div class="control-group search-group" style="margin:0;float:left;">
        <ul id="tagList" class="tagList">
            {loop $countList $k $v}
              <li>{$v['prizeName']}--{$v['remain_count']}</li>
            {/loop}
        </ul>
    </div>

    <div class="control-group search-group" style="margin:5;float:left;">
        <div class="controls">
            <button class="btn" id="inshow">指定用户获奖</button>
        </div>
    </div>

    <form id="distribution" class="form-horizontal" method="post" action="index.php?c=admin&a=distributionPrize" style="display:none;">
    <div class="control-group search-group" style="margin:0;">
        <label class="control-label" >用户id：</label>
        <div class="controls">
          <input type="text" placeholder="用户ID" name="uid">
        </div>
    </div>

    <div class="control-group search-group" style="margin:0;">
        <div class="controls">
            <select name="prize">
                <option value="-1">请选择奖品</option>
                {loop $prizeInfo $k $v}
                <option value="{$k}">{$v}</option>
                {/loop}
            </select>
        </div>
    </div>
    <div class="control-group search-group" style="margin:0;">
        <div class="controls">
            <button class="btn" type="submit">提交</button>
            <button class="btn" type="reset" id="inhide">取消</button>
        </div>
    </div>
</form>

<div class="bs-docs-example table-align pt-15" style="clear:both;">
    <table class="table table-striped">
        <thead>
            <tr>
                <th>用户ID</th>
                <th>姓名</th>
                <th>电话号码</th>
                <th>地址</th>
                <th>尺码</th>
                <th>所中奖品</th>
            </tr>
        </thead>
        <tbody>
            {if !$list}  
                <tr>
                    <td colspan="6">暂无记录</td>
                </tr>
            {else}

            {loop $list $k $v}
            <tr>
                <td>{$v['uid']}</td>
                <td>{$v['name']}</td>
                <td>{$v['phone']}</td>
                <td>{$v['address']}</td>
                <td>{$v['size']}</td>
                <td>{$v['prizeName']}</td>
            </tr>
            {/loop}

            {/if}
        </tbody>
    </table>
</div>
</div>
    <div class="tab-pane active" id="panel-665242">
        <div class="bs-docs-example table-align pt-15" style="clear:both;">
            <table class="table table-striped">
                <thead>
                    <tr>
                        <th>用户ID</th>
                        <th>注册时间</th>
                        <th>跑步里程(km)</th>
                        <th>跑步次数</th>
                        <th>已抽奖次数</th>
                    </tr>
                </thead>
                <tbody>
                    {if !$joinInfo}  
                        <tr>
                            <td colspan="5">暂无记录</td>
                        </tr>
                    {else}

                    {loop $joinInfo $k $v}
                    <tr>
                        <td>{$v['uid']}</td>
                        <td>{$v['addtime']}</td>
                        <td>{$v['mileage']}</td>
                        <td>{$v['count']}</td>
                        <td>{$v['draw_count']}</td>
                    </tr>
                    {/loop}

                    {/if}
                </tbody>
            </table>
        </div>
        <div class="pagination">
            <ul>
                {$pageStr}
            </ul>
        </div>
    </div>
</div>
</div>

{template footer}
<script>
    $("#inshow").click(function(){
        $("#distribution").show();
        $("#distribution").fadeIn(300);
        var popMargTop = $("#distribution").height() / 2;
        var popMargLeft = $("#distribution").width() / 2;
    });
    $("#inhide").click(function(){
        $("#distribution").hide();
    });
</script>
